package edu.ntu.cloudroid.model.data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;


import com.sun.xacml.ctx.RequestCtx;

import edu.ntu.cloudroid.model.IDs;
import edu.ntu.cloudroid.model.profile.ProfileData;
import edu.ntu.cloudroid.server.backendservice.ProfileService;



@PersistenceCapable(detachable="true")
@Inheritance
@FetchGroup(name = AbstractData.FETCH_GROUP_NAME, members = { @Persistent(name = "person") })
public class TraceData extends AbstractData {

	@Persistent
	private List<Integer> landmarks;
	@Persistent
	private double heartRate;
	@Persistent
	private double speed;
	@Persistent
	private double distance;
	
	public TraceData(){
		
	}
	
	public TraceData(String name, Date ts, List<Integer> landmarks,
			double speed, double distance, double heartRate) throws Exception{
		this.setName(name);
		this.setTimestamp(ts);
		this.landmarks = landmarks;
		this.speed = speed;
		this.distance = distance;
		this.heartRate = heartRate;
	}
	
	@Override
	public int getDataId(){
		return IDs.DataID.TraceData.ordinal();
	}
	public List<Integer> getLandmarks() {
		return landmarks;
	}

	public double getHeartRate() {
		return heartRate;
	}

	public double getSpeed() {
		return speed;
	}

	public double getDistance() {
		return distance;
	}

	@Override
	public DetachedData detach(Object params) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int compareTo(String v, int idx) {
		// TODO Auto-generated method stub
		return 0;
	}

	
	@Override
	public AbstractData initialize(String[] entries) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object getWindowAverage(List<AbstractData> list, int idx) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public AbstractData getInstance() {
		return new TraceData();
	}

	@Override
	public int compareTo(AbstractData v, int idx) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Object changeGranuality(int granuality, int colIdx) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public AbstractData getDataFromRequest(RequestCtx requestCtx)
			throws Exception {
		// TODO Auto-generated method stub
		return null;
	}	

}
